@ECHO OFF
if "%1"=="" goto HELP_USAGE

SET BC3_PROGRAM=C:\Program Files\Beyond Compare 3\BComp.exe
SET LEFT_ROOT=E:\Upgrade\MergeFiles\Customer
SET RIGHT_ROOT=E:\Upgrade\MergeFiles\930SP5
SET ANCESTOR_ROOT=E:\Upgrade\MergeFiles\920SP6
SET OUTPUT_ROOT=E:\Upgrade\MergeFiles\Output
SET FILE_NAME=%*
SET LEFT_FILE=%LEFT_ROOT%\%FILE_NAME%
SET RIGHT_FILE=%RIGHT_ROOT%\%FILE_NAME%
SET ANCESTOR_FILE=%ANCESTOR_ROOT%\%FILE_NAME%
SET MERGED_FILE=%OUTPUT_ROOT%\%FILE_NAME%
SET BC3_ARGS=/title1="Crytek: %LEFT_FILE%" /title2="Xaviant: %RIGHT_FILE%" /title3="Ancestor: %ANCESTOR_FILE%" /title4="Merged: %MERGED_FILE%" /automerge /nobackups /reviewconflicts

"%BC3_PROGRAM%" %BC3_ARGS% "%LEFT_FILE%" "%RIGHT_FILE%" "%ANCESTOR_FILE%" "%MERGED_FILE%"
goto EXIT

:HELP_USAGE
ECHO USAGE: AutoMerge "{relative file name}"
goto EXIT

:EXIT
@ECHO ON